package com.wxxymakers.cklabrecruit.config;

import org.springframework.cache.ehcache.EhCacheManagerFactoryBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @AUTHOR soft
 * @DATE 2018/11/6 0:20
 * @DESCRIBE
 */
@Configuration
public class EhcacheConfig {
    /**
     * 设置为共享模式
     * 解决多缓存同名bean冲突问题
     */
    @Bean
    public EhCacheManagerFactoryBean ehCacheManagerFactoryBean() {
        EhCacheManagerFactoryBean cacheManagerFactoryBean = new EhCacheManagerFactoryBean();
        cacheManagerFactoryBean.setShared(true);
        return cacheManagerFactoryBean;
    }
}
